import click
from app.bill.script.bill_click import BillClick


@click.group()
def bill_cli():
    pass


@bill_cli.command("bill_sync")
@click.option('--bill_cycle', type=str, help="从阿里云同步一个月的账单")
def sync_bill_from_aliyun(bill_cycle):
    """
    同步阿里云账单到本地数据库
    python manage.py bill_sync --bill_cycle 2023-06
    """
    bill_click = BillClick()
    bill_click.bill_sync_from_aliyun(bill_cycle)



@bill_cli.command("oa_sync")
@click.option('--month', type=str, help="从oa平台同步云资源工单信息")
def sync_asset_from_oa(month):
    """
    同步阿里云账单到本地数据库
    python manage.py oa_sync --month 2023-06
    """
    bill_click = BillClick()
    bill_click.sync_asset_from_oa(month)



# @bill_cli.command("bill_tag_department")
# @click.option('--file_path', type=str, help="excel文件路径")
# def update_tag_department_from_excel(file_path):
#     """
#     从execl文件更新标签部门关系表
#     python manage.py bill_tag_department --file_path tag_department信息.xlsx
#     """
#     bill_click = BillClick()
#     bill_click.update_tag_department_from_excel(file_path)


# @bill_cli.command("bill_analysis")
# @click.option('--bill_cycle', type=str, help="需要分析的账期")
# def sync_bill_from_aliyun(bill_cycle):
#     """
#     需要分析的账期，方便oa提单
#     python manage.py bill_analysis --bill_cycle 2022-03
#     """
#     bill_click = BillClick()
#     bill_click.bill_analysis(bill_cycle)


# @bill_cli.command("bill_group_by_department")
# @click.option('--bill_cycle', type=str, help="根据管理/所属部门聚合数据")
# def bill_group_by_department(bill_cycle):
#     """
#     根据管理/所属部门聚合数据
#     python manage.py bill_group_by_department --bill_cycle 2022-03
#     """
#     bill_click = BillClick()
#     bill_click.bill_group_by_department(bill_cycle)


# @bill_cli.command("bill_analysis_report")
# @click.option('--bill_year', type=str, help="云成本分析报告")
# def bill_analysis_report(bill_year):
#     """
#     根据管理/所属部门聚合数据
#     python manage.py bill_analysis_report --bill_cycle 2022-03
#     """
#     bill_click = BillClick()
#     bill_click.bill_analysis_report(bill_year)
    
    
    
# @bill_cli.command("bill_event_work_order")
# @click.option('--bill_cycle', type=str, help="根据管理/所属部门聚合数据")
# def bill_analysis_report(bill_cycle):
#     """
#     根据管理/所属部门聚合数据
#     python manage.py bill_event_work_order --bill_cycle 2023-02
#     """
#     bill_click = BillClick()
#     bill_click.bill_event_from_work_order(bill_cycle)